#ifndef CLIENT_H
#define CLIENT_H

#include <QtNetwork>
#include <QString>
#include <QTextEdit>
#include <QObject>
#include "message.h"

class client : public QObject
{
    Q_OBJECT

    public:
        client(QTextEdit*);
        ~client();
        bool connect(QString address, int port);

    public slots:
        void receiveChange();
        void textChanged(const int, const int, const int);

    private:
        void updateText(message);

        QTcpSocket *sock;
        QTextEdit *editor;
        int rev;
        QString doc;
        int id;
};

#endif // CLIENT_H
